/// **************************************************************************************************
/// "Copyright (c) 2007 Sai Panyam, Inc.  All rights reserved."
/// **************************************************************************************************
/// Component Name   :	PunctuationCollection, Member of System72.NTextile 
/// Description      :	PunctuationCollection description
/// Author           :	Sai Panyam
/// Creation Date    :	November 09 2007
/// Modified Date    :              
/// Modified By      :
/// **************************************************************************************************
using System.Collections.Generic;

namespace System72.NTextile
{
    /// <summary>
    /// 
    /// </summary>
    public class PunctuationCollection : List<Punctuation>
    {
        #region Private Variables

        private Punctuation m_punctuationToMatch;

        #endregion

        #region Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="punctuation"></param>
        /// <returns></returns>
        public bool ContainsPunctuation(Punctuation punctuation)
        {
            if (punctuation != null)
            {
                m_punctuationToMatch = punctuation;
                return Exists(punctuationSearchPredicate);
            }
            else
            {
                return false;
            }
        }

        #endregion

        #region Private Method
        /// <summary>
        /// 
        /// </summary>
        /// <param name="matchPunctuation"></param>
        /// <returns></returns>
        private bool punctuationSearchPredicate(Punctuation matchPunctuation)
        {
            if (matchPunctuation != null)
            {
                if (matchPunctuation.PunctuationType == m_punctuationToMatch.PunctuationType)
                {
                    return true;
                }
            }
            return false;
        }

        #endregion
    }
}